﻿<UserControl x:Class="EffectiveCapacityReport.LossByMonth"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:telerikChart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"
    xmlns:telerikCharting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"
    mc:Ignorable="d"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"   
    d:DesignHeight="300" d:DesignWidth="400">

    <!--<UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="style/style.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>-->

    <!--<StackPanel x:Name="LayoutRoot" Background="#2a2f36"  >-->
    <telerikChart:RadChart x:Name="radChart" ItemsSource="{Binding MonthlyLossList}" Style="{StaticResource ChartStyle}" TitleStyle="{StaticResource ChartTitleStyle}" LegendStyle="{StaticResource ChartLegendStyle}">
        <i:Interaction.Triggers>
            <i:EventTrigger  EventName="MouseLeftButtonDown">
                <i:InvokeCommandAction Command="{Binding RadChartMouseLeftButtonCommand}" 
        							CommandParameter="{Binding ElementName=radChart}"  />
            </i:EventTrigger>
        </i:Interaction.Triggers>
        <telerikChart:RadChart.DefaultView>
                <telerikCharting:ChartDefaultView ChartLegendPosition="Top">

                    <telerikCharting:ChartDefaultView.ChartTitle>
                        <telerikCharting:ChartTitle Content="Umm Shaif  Losses(monthly)" HorizontalAlignment="Stretch"/>
                    </telerikCharting:ChartDefaultView.ChartTitle>

                    <telerikCharting:ChartDefaultView.ChartLegend>
                        <telerikCharting:ChartLegend x:Name="chartLegend" Header=""/>
                    </telerikCharting:ChartDefaultView.ChartLegend>

                    <telerikCharting:ChartDefaultView.ChartArea>


                        <telerikCharting:ChartArea LegendName="chartLegend"   PlotAreaStyle="{StaticResource ClipPanelStyle}" SmartLabelsEnabled="True"
                                                   >

                            <telerikCharting:ChartArea.AxisX>
                                <telerikCharting:AxisX Title="" IsDateTime="False" LayoutMode="Between">
                                    <telerikCharting:AxisX.AxisStyles>
                                        <telerikCharting:AxisStyles AxisLineStyle="{StaticResource AxisLineStyle}" TickLineStyle="{StaticResource AxisTickStyle}" GridLineStyle="{StaticResource GridLineStyle}" ItemLabelStyle="{StaticResource XItemLabelStyle}" TitleStyle="{StaticResource AxisTitleStyle}">
                                        </telerikCharting:AxisStyles>
                                    </telerikCharting:AxisX.AxisStyles>
                                </telerikCharting:AxisX>
                            </telerikCharting:ChartArea.AxisX>

                            <telerikCharting:ChartArea.AxisY>
                                <telerikCharting:AxisY Title="MBD"  StripLinesVisibility="Collapsed" MajorGridLinesVisibility="Visible" MinorTicksVisibility="Collapsed" ExtendDirection="None" >
                                    <telerikCharting:AxisY.AxisStyles>
                                        <telerikCharting:AxisStyles AxisLineStyle="{StaticResource AxisLineStyle}" TickLineStyle="{StaticResource AxisTickStyle}" GridLineStyle="{StaticResource GridLineStyle}" ItemLabelStyle="{StaticResource YItemLabelStyle}" TitleStyle="{StaticResource AxisTitleStyle}">
                                        </telerikCharting:AxisStyles>
                                    </telerikCharting:AxisY.AxisStyles>
                                </telerikCharting:AxisY>
                            </telerikCharting:ChartArea.AxisY>                           
                            
                        </telerikCharting:ChartArea>
                    </telerikCharting:ChartDefaultView.ChartArea>
                </telerikCharting:ChartDefaultView>
            </telerikChart:RadChart.DefaultView>

        <telerik:RadChart.SeriesMappings>
            <telerik:SeriesMapping CollectionIndex="0" LegendLabel="Res.Cap">
                <telerik:SeriesMapping.SeriesDefinition>
                    <telerikCharting:LineSeriesDefinition ShowPointMarks="True">
                        <telerikCharting:LineSeriesDefinition.Appearance>

                            <telerikCharting:SeriesAppearanceSettings Stroke="Red" StrokeThickness="2" Fill="Transparent">
                                <telerikCharting:SeriesAppearanceSettings.PointMark>
                                    <telerikCharting:PointMarkAppearanceSettings Shape="Diamond" Stroke="Red" StrokeThickness="1" Fill="Red" ></telerikCharting:PointMarkAppearanceSettings>
                                </telerikCharting:SeriesAppearanceSettings.PointMark>
                            </telerikCharting:SeriesAppearanceSettings>
                        </telerikCharting:LineSeriesDefinition.Appearance>
                    </telerikCharting:LineSeriesDefinition>
                </telerik:SeriesMapping.SeriesDefinition>
                <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue" />
                <telerik:ItemMapping DataPointMember="XCategory" FieldName="XCategory" />
            </telerik:SeriesMapping>

            <telerik:SeriesMapping CollectionIndex="1" LegendLabel="Eff.Cap">
                <telerik:SeriesMapping.SeriesDefinition>
                    <telerikCharting:LineSeriesDefinition ShowPointMarks="True">
                        <telerikCharting:LineSeriesDefinition.Appearance>
                            <telerikCharting:SeriesAppearanceSettings Stroke="Yellow" StrokeThickness="2" Fill="Transparent">
                                <telerikCharting:SeriesAppearanceSettings.PointMark>
                                    <telerikCharting:PointMarkAppearanceSettings Shape="Square" Stroke="Yellow" StrokeThickness="1" Fill="Yellow" ></telerikCharting:PointMarkAppearanceSettings>
                                </telerikCharting:SeriesAppearanceSettings.PointMark>
                            </telerikCharting:SeriesAppearanceSettings>
                        </telerikCharting:LineSeriesDefinition.Appearance>
                    </telerikCharting:LineSeriesDefinition>
                </telerik:SeriesMapping.SeriesDefinition>
                <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue" />
                <telerik:ItemMapping DataPointMember="XCategory" FieldName="XCategory" />
            </telerik:SeriesMapping>

            <telerik:SeriesMapping CollectionIndex="2" LegendLabel="Monitor">
                <telerik:SeriesMapping.SeriesDefinition>
                    <telerikCharting:StackedBarSeriesDefinition StackGroupName="DivisionLoss" ShowItemToolTips="True" ShowItemLabels="False" >
                        <telerikCharting:StackedBarSeriesDefinition.Appearance>
                            <telerikCharting:SeriesAppearanceSettings Fill="Orange"/>
                        </telerikCharting:StackedBarSeriesDefinition.Appearance>
                        <telerikCharting:StackedBarSeriesDefinition.LabelSettings>
                            <telerikCharting:BarLabelSettings   LabelDisplayMode="Inside" />
                        </telerikCharting:StackedBarSeriesDefinition.LabelSettings>
                    </telerikCharting:StackedBarSeriesDefinition>
                </telerik:SeriesMapping.SeriesDefinition>
                <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue" />
                <telerik:ItemMapping DataPointMember="XCategory" FieldName="XCategory" />
            </telerik:SeriesMapping>

            <telerik:SeriesMapping CollectionIndex="3" LegendLabel="Unplanned">
                <telerik:SeriesMapping.SeriesDefinition>
                    <telerikCharting:StackedBarSeriesDefinition StackGroupName="DivisionLoss" ShowItemLabels="False"  ShowItemToolTips="True">
                        <telerikCharting:StackedBarSeriesDefinition.Appearance>
                            <telerikCharting:SeriesAppearanceSettings Fill="DarkRed"/>
                        </telerikCharting:StackedBarSeriesDefinition.Appearance>
                        <telerikCharting:StackedBarSeriesDefinition.LabelSettings>
                            <telerikCharting:BarLabelSettings  Distance="10" LabelDisplayMode="Outside" />
                        </telerikCharting:StackedBarSeriesDefinition.LabelSettings>
                    </telerikCharting:StackedBarSeriesDefinition>
                </telerik:SeriesMapping.SeriesDefinition>
                <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue" />
                <telerik:ItemMapping DataPointMember="XCategory" FieldName="XCategory" />
            </telerik:SeriesMapping>

            <telerik:SeriesMapping CollectionIndex="4" LegendLabel="Drilling">
                <telerik:SeriesMapping.SeriesDefinition>
                    <telerikCharting:StackedBarSeriesDefinition StackGroupName="DivisionLoss" ShowItemToolTips="True" ShowItemLabels="False" >
                        <telerikCharting:StackedBarSeriesDefinition.Appearance>
                            <telerikCharting:SeriesAppearanceSettings Fill="Blue"/>
                        </telerikCharting:StackedBarSeriesDefinition.Appearance>
                        <telerikCharting:StackedBarSeriesDefinition.LabelSettings>
                            <telerikCharting:BarLabelSettings  Distance="10" LabelDisplayMode="Outside" />
                        </telerikCharting:StackedBarSeriesDefinition.LabelSettings>
                    </telerikCharting:StackedBarSeriesDefinition>
                </telerik:SeriesMapping.SeriesDefinition>
                <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue" />
                <telerik:ItemMapping DataPointMember="XCategory" FieldName="XCategory" />
            </telerik:SeriesMapping>

            <telerik:SeriesMapping CollectionIndex="5" LegendLabel="Projects">
                <telerik:SeriesMapping.SeriesDefinition>
                    <telerikCharting:StackedBarSeriesDefinition StackGroupName="DivisionLoss" ShowItemToolTips="True" ShowItemLabels="False" >
                        <telerikCharting:StackedBarSeriesDefinition.Appearance>
                            <telerikCharting:SeriesAppearanceSettings Fill="Green"/>
                        </telerikCharting:StackedBarSeriesDefinition.Appearance>
                        <telerikCharting:StackedBarSeriesDefinition.LabelSettings>
                            <telerikCharting:BarLabelSettings  Distance="10" LabelDisplayMode="Outside" />
                        </telerikCharting:StackedBarSeriesDefinition.LabelSettings>
                    </telerikCharting:StackedBarSeriesDefinition>
                </telerik:SeriesMapping.SeriesDefinition>
                <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue" />
                <telerik:ItemMapping DataPointMember="XCategory" FieldName="XCategory" />
            </telerik:SeriesMapping>

            <telerik:SeriesMapping CollectionIndex="6" LegendLabel="Maint">
                <telerik:SeriesMapping.SeriesDefinition>
                    <telerikCharting:StackedBarSeriesDefinition StackGroupName="DivisionLoss" ShowItemLabels="False" ShowItemToolTips="True">
                        <telerikCharting:StackedBarSeriesDefinition.Appearance>
                            <telerikCharting:SeriesAppearanceSettings Fill="CadetBlue"/>
                        </telerikCharting:StackedBarSeriesDefinition.Appearance>
                        <telerikCharting:StackedBarSeriesDefinition.LabelSettings>
                            <telerikCharting:BarLabelSettings  Distance="10" LabelDisplayMode="Outside"/>
                        </telerikCharting:StackedBarSeriesDefinition.LabelSettings>
                    </telerikCharting:StackedBarSeriesDefinition>
                </telerik:SeriesMapping.SeriesDefinition>
                <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue" />
                <telerik:ItemMapping DataPointMember="XCategory" FieldName="XCategory" />
            </telerik:SeriesMapping>

            <telerik:SeriesMapping CollectionIndex="7" LegendLabel="Integrity">
                <telerik:SeriesMapping.SeriesDefinition>
                    <telerikCharting:StackedBarSeriesDefinition StackGroupName="DivisionLoss" ShowItemLabels="False" ShowItemToolTips="True">
                        <telerikCharting:StackedBarSeriesDefinition.Appearance>
                            <telerikCharting:SeriesAppearanceSettings Fill="DarkViolet"/>
                        </telerikCharting:StackedBarSeriesDefinition.Appearance>
                        <telerikCharting:StackedBarSeriesDefinition.LabelSettings>
                            <telerikCharting:BarLabelSettings  Distance="10" LabelDisplayMode="Outside"/>
                        </telerikCharting:StackedBarSeriesDefinition.LabelSettings>
                    </telerikCharting:StackedBarSeriesDefinition>
                </telerik:SeriesMapping.SeriesDefinition>
                <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue" />
                <telerik:ItemMapping DataPointMember="XCategory" FieldName="XCategory" />
            </telerik:SeriesMapping>

            <telerik:SeriesMapping CollectionIndex="8" LegendLabel="Sum">
                <telerik:SeriesMapping.SeriesDefinition>
                    <telerikCharting:ScatterSeriesDefinition  ShowItemLabels="True" SeriesItemLabelStyle="{StaticResource SumSeriesItemLabelStyle}">
                        <telerikCharting:ScatterSeriesDefinition.Appearance>
                            <telerikCharting:SeriesAppearanceSettings Fill="Transparent"/>
                        </telerikCharting:ScatterSeriesDefinition.Appearance>
                    </telerikCharting:ScatterSeriesDefinition>
                </telerik:SeriesMapping.SeriesDefinition>
                <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue" />
                <telerik:ItemMapping DataPointMember="XCategory" FieldName="XCategory" />
                <telerik:ItemMapping DataPointMember="Label" FieldName="Label" />
            </telerik:SeriesMapping>

        </telerik:RadChart.SeriesMappings>

    </telerikChart:RadChart>

    <!--</StackPanel>-->
</UserControl>
